// 引入组件
import login from '@/components/business/login.vue'
import register from '@/components/business/register.vue'
import BusinessIndex from '@/components/business/index.vue'
import BusinessProfile from '@/components/business/profile.vue'

// 嵌套的子路由列表
const list = [
    {
        path: 'login', // 组装的真实的地址： /business/login
        name: 'login',
        component: login,
    },
    {
        path: 'register',
        name: 'register',
        component: register,
    },
    {
        path: 'index',
        name: 'BusinessIndex',
        component: BusinessIndex,
        meta: { IsLogin: true }
    },
    {
        path: 'profile',
        name: 'BusinessProfile',
        component: BusinessProfile,
        meta: { IsLogin: true }
    },
]

//父组件结构
const layout = {
    template: `<router-view></router-view>`
}

export default [{
    name: 'business', //一级路由地址
    path: '/business',
    component: layout,
    children: list,
}]
